﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="物料分类编辑.aspx.cs" Inherits="syc.Store.物料分类编辑" %>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"
 SelectCommand="select @FID=FID,@LV=LV,@名称=名称 from 物料分类 where ID=@ID"
 InsertCommand="insert into 物料分类(ID,FID,LV,名称)values(@ID,@FID,@LV,@名称)"
 UpdateCommand="update 物料分类 set 名称=@名称 WHERE ID=@ID;"
    onselected="SqlDataSource1_Selected">

<SelectParameters>
<asp:Parameter Name="ID" Type="Int32" Size="4" />
<asp:Parameter Name="FID" Type="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="LV" Type="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="名称" Type="String" Size="40" Direction="Output" />
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Int32" Size="4"/>
<asp:ControlParameter Name="FID" Type="Int32" Size="4" ControlID="FID" />
<asp:ControlParameter Name="LV" Type="Int32" Size="4" ControlID="LV" />
<asp:ControlParameter Name="名称" Type="String" Size="40" ControlID="MingCheng" />
</InsertParameters>
<UpdateParameters>
<asp:ControlParameter Name="ID" Type="Int32" Size="4" ControlID="FID" />
<asp:ControlParameter Name="名称" Type="String" Size="40" ControlID="MingCheng" />
</UpdateParameters>
</asp:SqlDataSource>

<asp:Label ID="FID" runat="server" Text="" Visible="false"></asp:Label>
<asp:Label ID="LV" runat="server" Text="" Visible="false"></asp:Label>

<div id="wintop" class="wintop" style="display:none;">物料分类</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <asp:Button ID="Button_Save" runat="server" Text="保 存" UseSubmitBehavior="false" 
        CssClass="button" onclick="Button_Save_Click"  />
    <input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel">
<table border="1" style="border-collapse:separate;font-size:14px;">
<tr>
<td width="100" height="26" style="padding:3px;">上级编码：</td>
<td width="290"><asp:TextBox ID="ShangJi" runat="server" Width="120px" Enabled="false" BackColor="#eeeeee" CssClass="txt"></asp:TextBox></td>
</tr>
<tr>
<td height="26" style="padding:3px;">编 码：</td>
<td><asp:TextBox ID="BianMa" runat="server" Width="120px" CssClass="txt"></asp:TextBox>
<asp:Label ID="Label_LV" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td height="26" style="padding:3px;">名 称：</td>
<td><asp:TextBox ID="MingCheng" runat="server" Width="120px" CssClass="txt"></asp:TextBox></td>
</tr>

</table>
<div style="font-size:14px;line-height:18px;">
<font color=red >提示：</font>
<br />(1) 系统中物料被设计为大、中、小 3 个级别的分类；
<br />(2) 大类编码为2位数字，取值范围为 01 ～ 20 ；
<br />(3) 中类编码为2位数字，取值范围为 01 ～ 99 ；
<br />(4) 小类编码为3位数字，取值范围为 01 ～ 999 ；
<br />(5) 整个分类编码合计为 7 位，如：0205015 。
<br /><br />
</div>
</asp:Panel>

</form>
<script>
    var notice = '<%=this.Notice %>';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
</script>
<script>
    document.onkeydown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName != "INPUT" || tag.className != "txt") return;
        if (e.keyCode == 13) {
            if (tag.id == "MingCheng") {
                document.getElementById("Button_Save").focus();
                return false;
            }
            e.keyCode = 9;
        }
    }
<%=this.Autorun %>
</script>
</body>
</html>